package com.design.YiTong.user.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.design.YiTong.common.result.Result;
import com.design.YiTong.model.user.DocInfo;
import com.design.YiTong.user.service.DocInfoService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/admin/user/doctor")
public class DoctorContorller {
    @Autowired
    private DocInfoService docInfoService;
    @ApiOperation(value = "查询医生")
    @GetMapping("show/{docDep}")
    public Result showDoc(@PathVariable String docDep){
        List<DocInfo> pageModel=docInfoService.showDoc(docDep);
        return Result.ok(pageModel);
    }
    @ApiOperation(value = "查询医生认证")
    @GetMapping("showAuth")
    public Result showDoc(){
        List<DocInfo> pageModel=docInfoService.showAuth();
        return Result.ok(pageModel);
    }
    @ApiOperation("医生认证")
    @PostMapping("/auth")
    public Result DocAuth(@RequestBody DocInfo docInfo){
        docInfoService.DocAuth(docInfo);
        return Result.ok();
    }
    @ApiOperation("状态转换")
    @PostMapping("/access/{id}")
    public Result access(@PathVariable long id){
        docInfoService.access(id);
        return Result.ok();
    }
}
